﻿<%@ Page Title="" Language="C#" MasterPageFile="../Shared/Manager.Master" Inherits="System.Web.Mvc.ViewPage<ProductViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="partTask search">
        <% using (Html.BeginForm("CommentProduct", "Comment", FormMethod.Post)) { %>
        <select name="audit" id="selAudit">
            <option value="a">全部评论</option>
            <option value="t">已审核</option>
            <option value="f">未审核</option>
        </select>
        <input type="submit" value="搜索" />
        <%=Html.UrlButton("显示全部", Url.Action("CommentProduct", "Comment"), "urlBtn")%>
        <% } %>
    </div>
    <div class="btnBar">
        <div class="btnBarLeft ">
            <div class="divPager2">
                <%= Html.Pager(Model.Pager) %>
            </div>
        </div>
    </div>
    <ul id="ullist">
        <% foreach (ProductEntity item in Model.ProductList) { %>
        <li>
            <div class="product_img">
                <a href="<%= Url.Action("Preview", "Product", new {ProductId = item.ProductId}) %>"
                    target="_blank">
                    <img src="<%= string.Format("{0}/{1}/s_{2}", Model.ImageRoot, item.ProductId, item.ImageName) %>"
                        alt="<%= item.ProductName %>" class="img1" title="<%= item.ProductName %>" /></a>
            </div>
            <div class="product_memo">
                <dl>
                    <dt><span class="floatRight">
                        <%=Html.UrlButton("显示评论", Url.Action("CommentList", "Comment", new { 
                            audit=ViewData["Audit"], 
                            productPage = Model.PageNumber, 
                            productId = item.ProductId 
                        }), "urlBtn") %>
                    </span>
                        <%=item.ProductName %></dt>
                    <dd>
                        上线时间：<%=item.SaleDateTime %>
                    </dd>
                    <dd>
                        激活状态：<%=Html.CheckBox("isActive", item.IsActive, new { disabled="disabled" })%></dd>
                    <dd>
                        商品编号：<%=item.ProductNo %></dd>
                    <dd>
                        零售价：<%=item.Price %></dd>
                    <dd>
                        折扣率：<%=item.DisCount.ToString("0.00") %></dd>
                    <dd>
                        实际销售价：<%=(item.Price * (decimal)item.DisCount).ToString("0.00") %></dd>
                    <dd>
                        库存数：<%=item.StockCount %></dd>
                    <dd>
                        点击数：<%=item.ClickCount %></dd>
                    <dd>
                        评论数：[已审核
                        <%=item.ReplyCount %>
                        未审核
                        <%=item.UnAuditCommentNum %>]</dd>
                </dl>
            </div>
        </li>
        <% } %>
    </ul>
    <div class="btnBar">
        <div class="btnBarLeft ">
            <div class="divPager2">
                <%= Html.Pager(Model.Pager) %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CssLink" runat="server">
    <link href="<%=Url.Content("~/Css/Manager/Product.css") %>" rel="stylesheet"
        type="text/css" />
    <link href="<%=Url.Content("~/Css/Manager/ProductList.css") %>" rel="stylesheet"
        type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JsLink" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cssContent" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="jsContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#ullist li:odd").attr("class", "alter");
            $("#selAudit").val('<%=ViewData["Audit"] %>');
        });
    </script>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="TopContent" runat="server">
</asp:Content>
